Deployment Revert Process
Overviewβ
This document describes how to revert to a previous deployment in production for the Webapp, Backend and Workers services.
Reverting a production deployment is rare and should be carefully considered. Always discuss with the team before proceeding. We have
WebApp (nextjs+vercel)β
Deployment is done automatically by Vercel on push on production branch. To revert the deployment to previous deployed version:
- Vercel production webapp deployments
- Find the previous deployment we want to revert to > click on it
- On the single deployment page > 3 dots >
Redeploy

Notice: Vercel support Instant Rollback option, which restores the selected deployment.
We choose not to use this option for 2 reasons:
- All environment variables, cron jobs, etc., revert to that deploymentβs state
- Vercel will turn off auto-assignment of production domains. This means that when you or your team push changes to production, the roll backed deployment won't be replaced.
Backend and Workersβ
Deployment is done using github action triggered when merging to production branch. The action checkout the code, build the docker image, push it to ECR and deploy the image (for worker no deployment as we run the docker container on demand)
To revert the deployment to previous deployed version:
Backend - Github UI
- Backend repo deploy action
- Find the relevant previous deployment (you can identify by commit hash or timestamp) > click on it
Re-run all jobs- it will re-run the action on the same commit which will result is deployment of this version
Worker - Github UI
- Investigation worker repo deploy actions
- Find the relevant previous deployment (you can identify by commit hash or timestamp) > click on it
Re-run all jobs- it will re-run the action on the same commit which will result is deployment of this version

π¨ Bonus: In-Production Revert Guide (Not Recommended)β
Warning: This emergency-only process is extremely rare and should be carefully considered. Always discuss with the team before proceeding.
Use this only if all other recovery options have been exhausted.
1. Revert in Productionβ
You have two rollback options in production:
1.a. Revert a Single Commitβ
GitHub UIβ
- Select the production branch in your repo.
- Find the bad commit in Commits, click Revert.
- GitHub creates a temporary revert branch.
- Open a PR from that branch β production, review, then merge.
Command Lineβ
# New branch for revert
git checkout -b revert-bad-commit origin/production
# Revert commit
git revert <SHA>
# Push branch
git push origin revert-bad-commit
- Then open a PR revert-bad-commit β production and merge.
1.b. Revert an Entire Deployment PRβ
- On the merged deployment PR (
mainβproduction), click Revert. - GitHub generates a new PR that undoes the original.
- Review and merge this PR into production.
2. Merge the Revert into mainβ
- Create a branch:
git checkout -b merge-revert-into-main origin/main - Merge updated production:
git fetch origin
git merge origin/production - Resolve conflicts, commit, then:
git push origin merge-revert-into-main:<remote branch> - Open PR β
main, review, merge.
3. Revert the Revert on mainβ
Restore the feature:
git checkout -b restore-feature
git revert <REVERT_SHA>
git push origin restore-feature
- Open PR restore-feature β main, review, merge.
4. Fix the Original Bug (Re-apply with a Fix)β
git checkout -b fix-production-issue
git add .
git commit -m "Fix: [describe the fix]"
git push origin fix-production-issue
- Open PR fix-production-issue β main, review, merge.
5. Create PR Back to productionβ
- Open PR
mainβproduction. - Describe revert, restore, fixes.
- Assign reviewers & merge.